#include <iostream>

using namespace std;

class Lu{
public:
    Lu(){
        cout << "copy" << endl;
    }
};

void test1(){
    Lu c1, *c2;
    Lu *c3 = new Lu;
    Lu &c4 = c1;

}

class BinInsert{
public:
    static int binInsert(int n, int m, int j, int i){
        m = m << j;
        return n + m;
    }
};

void Test1(){
    cout << BinInsert().binInsert(1024, 19, 2, 6);
}

bool isPrime(int n){
    for (int i = 2; i*i <= n; ++i) {
        if (n % i == 0)
            return false;
    }
    return true;
}

void Test2(){
    int n;
    cin >> n;
    int left = n / 2;
    int right = n / 2;
    while (left >= 2){
        if (isPrime(left) && isPrime(right)){
            cout << left << endl << right << endl;
            break;
        } else{
            --left;
            ++right;
        }
    }
}

int main() {
    //test1();
    Test2();
    return 0;
}

